Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't output errorneous proofs for invalid cell indices, return error… #40

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

luka-ethernal
Copy link
Contributor

… instead.

@luka-ethernal
Copy link
Contributor Author

… instead.

I hate this sooo much.

@@ -376,7 +377,7 @@ pub fn build_proof<M: Metrics>(
for (cell, res) in cell_iter {
let r_index = usize::try_from(cell.row.0)?;
if r_index >= ext_rows || cell.col >= block_dims.cols {
res.fill(0); // for bad cell identifier, fill whole proof with zero bytes !
return Err(Error::IndexOutOfRange);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we please use avail_core::ensure here? That could remove the if-else

@luka-ethernal luka-ethernal merged commit 41fe993 into main Sep 1, 2023
1 check passed
@luka-ethernal luka-ethernal deleted the luka/dont-ignore-errors branch September 1, 2023 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants